package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @SentinelResource(value = "helloResource", blockHandler = "helloBlockHander",
            blockHandlerClass = MonitorController.class)

    @GetMapping("/hello")
    public String hello() {
        return "hello sentinel";
    }

    @GetMapping("/hello2")
    public String hello2() {
        return "hello sentinel2";
    }
}
